<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./iscroll.js"></script>
    <script src="./vue.js"></script>
</head>

<body>
    <!-- 注意：要在mounted钩子函数中，初始化iScroll对象 -->
    <style>
        * {
            margin: 0px;

        }

        ul {
            list-style-type: none;
        }

        #myScroll {
            border: 1px solid #0094ff;
            width: 200px;
            height: 200px;
            overflow: hidden;
            position: relative;
        }
    </style>

    <button id="btn">新增数据项</button>
    <input type="text" v-model="usrStr">
    <div id="app">
        <div id="myScroll">
            <ul>
                <li v-for="(item,index) in list" :key="index">{{item + '-' + index}}</li>

            </ul>
        </div>

    </div>

    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                usrStr: '',
                list: ['x', 's', 'w', 'w', 'x', 's', 'w', 'w', 'x', 's', 'w', 'w', 'x', 's', 'w', 'w']
            },
            mounted() {
                let myScro = new IScroll('#myScroll', {

                    mouseWheel: true,
                    scrollbars: true
                })
            }

        })


    </script>

</body>

</html>